package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WaterDailyUsageMapper;
import com.ruoyi.system.domain.WaterDailyUsage;
import com.ruoyi.system.service.IWaterDailyUsageService;

/**
 * 日用水量Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-20
 */
@Service
public class WaterDailyUsageServiceImpl implements IWaterDailyUsageService 
{
    @Autowired
    private WaterDailyUsageMapper waterDailyUsageMapper;

    /**
     * 查询日用水量
     * 
     * @param id 日用水量主键
     * @return 日用水量
     */
    @Override
    public WaterDailyUsage selectWaterDailyUsageById(Long id)
    {
        return waterDailyUsageMapper.selectWaterDailyUsageById(id);
    }

    /**
     * 查询日用水量列表
     * 
     * @param waterDailyUsage 日用水量
     * @return 日用水量
     */
    @Override
    public List<WaterDailyUsage> selectWaterDailyUsageList(WaterDailyUsage waterDailyUsage)
    {
        return waterDailyUsageMapper.selectWaterDailyUsageList(waterDailyUsage);
    }

    /**
     * 新增日用水量
     * 
     * @param waterDailyUsage 日用水量
     * @return 结果
     */
    @Override
    public int insertWaterDailyUsage(WaterDailyUsage waterDailyUsage)
    {
        waterDailyUsage.setCreateTime(DateUtils.getNowDate());
        return waterDailyUsageMapper.insertWaterDailyUsage(waterDailyUsage);
    }

    /**
     * 修改日用水量
     * 
     * @param waterDailyUsage 日用水量
     * @return 结果
     */
    @Override
    public int updateWaterDailyUsage(WaterDailyUsage waterDailyUsage)
    {
        return waterDailyUsageMapper.updateWaterDailyUsage(waterDailyUsage);
    }

    /**
     * 批量删除日用水量
     * 
     * @param ids 需要删除的日用水量主键
     * @return 结果
     */
    @Override
    public int deleteWaterDailyUsageByIds(Long[] ids)
    {
        return waterDailyUsageMapper.deleteWaterDailyUsageByIds(ids);
    }

    /**
     * 删除日用水量信息
     * 
     * @param id 日用水量主键
     * @return 结果
     */
    @Override
    public int deleteWaterDailyUsageById(Long id)
    {
        return waterDailyUsageMapper.deleteWaterDailyUsageById(id);
    }
}
